Módulo:Characters
local p = {} --[[ This function who origanly design for switching design on Characters's Template This function need two parameter: frame.args1: the text who need to be evaluate frame.args2: the size max of one line The result is an value need to be tested in template true: all lines are small false: one or more lines are large --]] function p.maxLen( frame ) local maxSize = tonumber(frame.args2) or 80 local tmpStr = string.gsub(frame.args1, "%[%[file:.-%]%]", "123") tmpStr = string.gsub(tmpStr, "%[%[:file:.-%|", "") tmpStr = string.gsub(tmpStr, "[%[|%]]", "") local tmpArray = mw.text.split(tmpStr, " ") local textLines = {} local maxChars = 0; for key, value in pairs(tmpArray) do value = mw.text.split(value, "\n") for i = 1, #value do textLines#textLines+1 = valuei end end for key, value in pairs(textLines) do if #value > maxChars then maxChars = #value end end if maxChars > maxSize then return false else return true end end function p.replaceLinks( links ) local results = links.args1 local linksArray = { ["%[%in the Family]"]="DEF +15%%", ["%[%Assault]"]="DEF +1000", ["%[%of the Clones]"]="Ki +1", ["%[%Regeneration]"]="Recover 3%% HP", ["%[%Diva]"]="Ki +2", ["%[%Berserker]"]="ATK +20%% when HP is 50%% or below", ["%[%Buddies]"]="Ki +1", ["%[%Bad Bosses]"]="ATK & DEF +25%% when HP is 80%% or below", ["%[%Battle]"]="Disables enemy's Rampage, and ATK +15%%", ["%[%Bombardment]"]="ATK +15%%", ["%[%Brainiacs]"]="ATK & DEF +10%%", ["%[%Beatdown]"]="ATK +10%%", ["%[%Warrior]"]="ATK +10%%", ["%[%Judgment]"]="DEF +20%%", ["%[%Connoisseur]"]="Recover 5%% HP", ["%[%Armored Squad]"]="ATK +25%%", ["%[%Underling]"]="Ki +1", ["%[%Courage]"]="Ki +1", ["%[%Coward]"]="Ki +1", ["%[%School]"]="ATK +500", ["%[%Boost]"]="ATK +15%%", ["%[%Demon]"]="Ki +1", ["%[%Duo]"]="ATK +20%%", ["%[%of the Universe]"]="ATK +25%%", ["%[%Future]"]="Ki +1", ["%[%Ray]"]="ATK +2000 when Super Attack is launched", ["%[%Absorption]"]="Ki +2", ["%[%Autocrats]"]="Ki +1", ["%[%Fighters]"]="ATK +10%%", ["%[%Ties]"]="Ki +2", ["%[%and Faith]"]="Ki +2", ["%[%Battle]"]="ATK +15%%", ["%[%Flee]"]="Ki +1 when HP is 30%% or below", ["%[%Enemy]"]="ATK +10%%", ["%[%Baba’s Fighter]"]="Ki +2", ["%[%Army]"]="DEF +1000", ["%[%Minion]"]="ATK +300", ["%[%Fighter]"]="Ki +2", ["%[%%(Link Skill%)%|Fusion]"]="Ki +2", ["%[%Failure]"]="Recover 3%% HP", ["%[%Visitor]"]="Ki +1", ["%[%Warriors]"]="ATK +20%%", ["%[%of Respect]"]="Ki +2", ["%[%Gentleman]"]="Ki +2", ["%[%Power]"]="ATK +15%%", ["%[%Warrior]"]="Ki +1, enemy DEF -2000", ["%[%Z%-Fighter]"]="Ki +2", ["%[%GT]"]="Ki +2", ["%[%of the Dragon Balls]"]="ATK +20%%", ["%[%Grudge]"]="Ki +1", ["%[%of Saiyans]"]="Ki +2", ["%[%Hero]"]="DEF +20%%", ["%[%of Justice]"]="ATK +25%%", ["%[%Infighter]"]="ATK +10%%, Enemy DEF -10%%", ["%[%Energy]"]="Ki +2", ["%[%Regeneration]"]="Recover 3%% HP", ["%[%Kamehameha]"]="ATK +2500 when Super Attack is launched", ["%[%Power]"]="ATK +5000 when Super Attack is launched", ["%[%Form]"]="ATK +2000 when Super Attack is launched", ["%[%Loyalty]"]="Ki +1", ["%[%Majin]"]="ATK & DEF +10%%", ["%[%Resurrection Plan]"]="Ki +2", ["%[%and Pupil]"]="Ki +1", ["%[%of Magic]"]="ATK +15%%", ["%[%Menaces]"]="Ki +1", ["%[%from the Future]"]="ATK +500", ["%[%Metamorphosis]"]="Recover 5%% HP", ["%[%Money Money]"]="Ki +1", ["%[%Than Meets the Eye]"]="ATK +300", ["%[%%(Link Skill%)%|Namekians]"]="Recover 5%% HP", ["%[%New]"]="ATK +200", ["%[%Frieza Army]"]="ATK & DEF +1000", ["%[%Nightmare]"]="ATK +10%%", ["%[%Upgrade]"]="Ki +2", ["%[%Warriors]"]="ATK +20%%", ["%[%9000]"]="ATK +10%%", ["%[%in a Flash]"]="Ki +3", ["%[%Patrol]"]="Ki +2", ["%[%Village Adventure]"]="ATK +15%%", ["%[%Bestowed by God]"]="ATK +2500 when Super Attack is launched", ["%[%for Battle]"]="Ki +2", ["%[%Prodigies]"]="ATK +10%%", ["%[%Respect]"]="ATK +500", ["%[%'F']"]="ATK +700", ["%[%Revival]"]="Ki +2", ["%[%Duo]"]="ATK +10%%, attacked enemy's DEF -15%%", ["%[%Lineage]"]="Ki +1", ["%[%Army]"]="ATK +300", ["%[%Pride]"]="ATK +15%%", ["%[%Roar]"]="ATK +25%%", ["%[%Warrior Race]"]="ATK +700", ["%[%Scientist]"]="Ki +2", ["%[%Dragons]"]="ATK +15%%", ["%[%the Limit]"]="Ki +2", ["%[%Speed]"]="Ki +2", ["%[%Pose]"]="Ki +2", ["%[%vs Soul]"]="Weakens Regeneration and Ki +1", ["%[%Retribution]"]="ATK +300", ["%[%in Unity]"]="Ki +1", ["%[%Clan in Space]"]="Ki +2", ["%[%Saiyan]"]="ATK +10%%", ["%[%Strike]"]="ATK +20%%", ["%[%Combat]"]="ATK +15%%", ["%[%Power]"]="Activate Penetration, ATK & DEF +1000", ["%[%Warrior]"]="Ki +1", ["%[%Team of Terror]"]="ATK +500", ["%[%Bardock]"]="Ki +1", ["%[%Turles]"]="Ki +1", ["%[%Telekinesis]"]="Enemy DEF -10%%", ["%[%First Awakened]"]="ATK +25%%", ["%[%Ginyu Force]"]="ATK +25%%", ["%[%Hera Clan]"]="Ki +2", ["%[%Strength]"]="Ki +1", ["%[%Incredible Adventure]"]="Ki +2", ["%[%Innocents]"]="ATK +10%%", ["%[%Saiyan Lineage]"]="Ki +1", ["%[%Students]"]="DEF +1000", ["%[%Wall Standing Tall]"]="Foils enemy's True Power and boosts ATK by 15%%", ["%[%for Conquest]"]="ATK +15%%", ["%[%as Nails]"]="DEF +1500", ["%[%of Power]"]="Ki +3", ["%[%Transform]"]="Ki +2", ["%[%School]"]="ATK +500, DEF +500", ["%[%Terrors]"]="Ki +2", ["%[%Lifeform]"]="Ki +2", ["%[%Bond]"]="Ki +2", ["%[%Most Malevolent]"]="ATK +15%%", ["%[%Gods]"]="ATK +10%%", ["%[%of Universe 6]"]="Ki +2", ["%[%Tournament Champion]"]="Ki +1", ["%[%Tournament Reborn]"]="ATK +300", ["%[%Xenoverse]"]="ATK +20%%", ["%[%Fighters]"]="ATK +15%%", "NamedLink"="Descriptions", } for key, value in pairs( linksArray ) do results = string.gsub(results,key,"" .. key .. " " .. value .. " ") end return results end return p